﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="datagrid.aspx.cs" Inherits="Web_datagrid" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <link rel="Stylesheet" href="../CSS/Style.css" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    </div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
                    <tr>
                        <td colspan="3" style="width: 100%">
        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" AlwaysShow="True" FirstPageText="首页"
                        HorizontalAlign="Right" LastPageText="末页" NextPageText="下一页" 
                        PageIndexBoxType="TextBox" PageSize="15" PrevPageText="上一页" ShowCustomInfoSection="Left"
                        ShowPageIndexBox="Always" Width="60%" CustomInfoHTML="共<font color=blue><b>%RecordCount%</b></font>条数据 每页：<font color=blue><b>%PageSize%</b></font> 条 共<font color=blue><b>%PageCount%</b></font>页 当前页：<font color=red><b>%CurrentPageIndex%/%PageCount%</b></font>" OnPageChanged="AspNetPager1_PageChanged" CustomInfoSectionWidth="50%">
        </webdiyer:AspNetPager>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" rowspan="2" style="width: 100%">
         <asp:GridView ID="GridView1" runat="server" CssClass="gvStyle" AlternatingRowStyle-CssClass="alt" PagerStyle-CssClass="pgr" DataKeyNames="id" Width="100%" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound">
             <PagerStyle CssClass="pgr" />
             <AlternatingRowStyle CssClass="alt" />
             <Columns>
                 <asp:TemplateField HeaderText="序号"> <ItemTemplate> 
                                 <%# (this.AspNetPager1.CurrentPageIndex - 1) * this.AspNetPager1.PageSize + Container.DataItemIndex + 1%>
                            </ItemTemplate> </asp:TemplateField>
                 <asp:BoundField DataField="type" HeaderText="项目类型" />
                 <asp:BoundField DataField="pname" HeaderText="项目名称" />
                 <asp:BoundField DataField="sub2" HeaderText="学科" />
                 <asp:BoundField DataField="builddate" HeaderText="申报日期" />
                 <asp:TemplateField HeaderText="附件">
                     <ItemTemplate>
                         <asp:HyperLink ID="HyperLink1" runat="server" ImageUrl="~/Images/attachment-green.png"
                             NavigateUrl='<%# Eval("attached") %>'></asp:HyperLink>
                     </ItemTemplate>
                 </asp:TemplateField>
                 <asp:TemplateField HeaderText="操作">
                     <ItemTemplate>
                         <asp:HyperLink ID="HyperLink2" runat="server" Enabled="False">查看</asp:HyperLink>
                     </ItemTemplate>
                 </asp:TemplateField>
             </Columns>
        </asp:GridView>
                        </td>
                    </tr>
                    <tr>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:Button ID="Button1" runat="server"  onmouseover="this.style.backgroundPosition='left -28px'" onmouseout="this.style.backgroundPosition='left top'" OnClick="Button1_Click" Text="导出excel" CssClass="btn-dy-blue" Height="28px" Width="101px"  />
    </form>
</body>
</html>
